package descentFly.away3D4.Generator.ENV02
{
	import away3d.containers.ObjectContainer3D;
	import away3d.entities.Mesh;
	import away3d.materials.ColorMaterial;
	import away3d.materials.MaterialBase;
	import away3d.primitives.Cylinder;
	import away3d.primitives.Sphere;
	
	import flash.display.BitmapData;
	import flash.display.Shape;
	import flash.filters.BitmapFilterQuality;
	import flash.filters.GlowFilter;
	import flash.geom.Matrix;
	import flash.geom.Matrix3D;
	import flash.geom.Vector3D;
	
	import jiglib.geometry.JSphere;
	import jiglib.physics.RigidBody;
	import jiglib.plugin.away3d4.Away3D4Mesh;
	import jiglib.plugin.away3d4.Away3D4Physics;

	public class df_fantasticPlane {
		public static function bmdGenarate(a_width: int, a_height: int, map: Array, spotSize: int = 100): BitmapData {
			var bmd: BitmapData = new BitmapData(a_width, a_height, true, 0);
			var shape: Shape = new Shape();
			shape.graphics.beginFill(0xFFFFFF, 1);
			shape.graphics.drawCircle(0, 0, spotSize);
			shape.graphics.endFill();
			
			
			map.forEach(function(item: Object, i: int, arr: Array): void {
				shape.filters = [
					new GlowFilter(item.color, 1, spotSize * item.size * 2, spotSize * item.size * 2, 3, BitmapFilterQuality.HIGH, false, true)
				];
				var mat: Matrix = new Matrix();
				mat.scale(item.size, item.size);
				mat.translate(item.x * a_width, item.y * a_height);
				bmd.draw(shape, mat);
			});
			return bmd;
		}
	}
}